import type { IStore } from '@/api/modules/auth/store';
import type { Rule } from 'ant-design-vue/es/form';

const formObj: IStore = {
  id: '',
  parentId: '',
  storeName: '',
  storeManager: '',
  storeNo: '',
  telephone: '',
  status: '',
  renew: '',
  expire: null,
  details: '',
  createTime: '',
  updateTime: '',
};

export const form = ref<IStore>({
  ...formObj,
});

export const formRef = ref();

export const resetForm = () => {
  form.value = {
    ...formObj,
  };
};
export const formRules: Record<keyof IStore, Rule[]> = {
  id: [],
  parentId: [],
  storeName: [{ required: true }],
  storeManager: [],
  storeNo: [],
  telephone: [],
  status: [],
  renew: [],
  expire: [],
  details: [],
  createTime: [],
  updateTime: [],
};
